package com.jjh.users.pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.jjh.common.pojo.BasePojo;

/**
 * 角色的pojo
 * 
 * @author Zjx
 */
public class ARole extends BasePojo<ARole>
{
	private int id;
	private String name;
	private String content;
	private byte status;
	
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date pubTime;
	
	
	private String statusStr ;
	
	/* 关联关系
	 * 一个角色有多个管理员
	 *  */
	private List<AAdmins> adminsList = new ArrayList<AAdmins>() ; 
	private List<ARoleMenu> roleMenuList = new ArrayList<ARoleMenu>();
	
	
	
	/**
	 * 根据status的值,和枚举中对应的值,
	 * 返回枚举对应的字符串
	 * @return
	 */
	public String getStatusStr()
	{
		for(AAdminsEnum enumTemp : AAdminsEnum.values())
		{
			if(enumTemp.toString().startsWith("STATUS_")
				&& enumTemp.getCode() == this.getStatus())
			{
				return enumTemp.getInfo() ; 
			}
		}
		return statusStr;
	}
	
	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public List<AAdmins> getAdminsList()
	{
		return adminsList;
	}

	public void setAdminsList(List<AAdmins> adminsList)
	{
		this.adminsList = adminsList;
	}

	public List<ARoleMenu> getRoleMenuList()
	{
		return roleMenuList;
	}

	public void setRoleMenuList(List<ARoleMenu> roleMenuList)
	{
		this.roleMenuList = roleMenuList;
	}

}
